package com.tm.constants;

import java.util.concurrent.TimeUnit;

/**
 * @author huangp
 * @create 2023-04-18 15:25
 */
public class RedisConstans {

    public static final String MSG_PROFIX_REDIS = "msg:";

    public static final String TOKEN_PROFIX_REDIS = "token:";

    public static final Long expire = 5L;

    public static final Long TOKEN_RXPIRE = 30L;

    public static final TimeUnit TIME_UNIT = TimeUnit.MINUTES;

    public static final Long CHECK_EXPIRE = 1000L * 60 * 4;


    public static String getKey(String phone){
        //前缀+手机号
        return  MSG_PROFIX_REDIS+phone;
    }

    /**
     * 生成token的key
     * @param phone
     * @return
     */
    public static String getToken(String phone){
        //Token前缀+手机号
        return  TOKEN_PROFIX_REDIS+phone;
    }
}
